package com.atguigu.lease.web.admin.schedule;

import com.atguigu.lease.web.admin.service.LeaseAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledTasks {
    Long count = 0L;
    @Autowired
    LeaseAgreementService leaseAgreementService;
    @Scheduled(cron = "0/10 * * * * ?")
    public void a(){
        count++;
        System.out.println("================执行第"+count+"次===============");
        // 扫描所有合同
        leaseAgreementService.updateStatus();
    }
}